<template>
  <div class="father">
		<h1>父组件</h1>
		<h4 v-show="phone">儿子给的手机:{{ phone }}</h4>
	 <Child @send-phone="getPhone"/>
  </div>
</template>

<script setup lang="ts" name="Father">
  import Child from './Child.vue'
	import { ref } from "vue";
	// 数据
	let phone=ref("")
	// 方法
	function getPhone(value:string){
		phone.value=value
	}
</script>

<style scoped>
	.father{
		background-color:rgb(165, 164, 164);
		padding: 20px;
    border-radius: 10px;
	}
	.father button{
		margin-right: 5px;
	}
</style>